package com.rs.mapper;

import java.lang.reflect.Proxy;

/**
 * 生成代理对象
 */
public class MapperProxyFactory {

    public static <T> T newInstance(Class<T> methodInterface) {
        final MapperProxy<T> methodProxy = new MapperProxy<T>(methodInterface);
        return (T) Proxy.newProxyInstance(
                Thread.currentThread().getContextClassLoader(),
                new Class[]{methodInterface},
                methodProxy);
    }

}
